package fr.geobert.prediction;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;

/**
 * The LangDbAdapter need corpus.txt to learn. corpus.txt have to be pushed in /sdcard/
 * read MyAutoCompleteTextView next
 */
public class PredictionActivity extends Activity {
    private MyAutoCompleteTextView mField;

	/**
	 *   
	 */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        mField = (MyAutoCompleteTextView)findViewById(R.id.test_field);
        mField.setAdapter(new MatchAdapter(this));
        mField.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        	// save the selected word _id for later 
			public void onItemClick(AdapterView<?> parent, View view, int position,
					long id) {
				Log.d("Prediction", "onItemClick savedInstanceState " + id);
				mField.selectedWord = id;
			}
		});
        mField.initialFiltering();
    }
    
    
}